<?
require("config.php");

$menutype = 2;

if (NULL!=$action){

	$dir = $table . "/";

	myUpload($Thumbnail,$Thumbnail_name,$dir);
	myUpload($Picture1,$Picture1_name,$dir);
	myUpload($Picture2,$Picture2_name,$dir);
	myUpload($Picture3,$Picture3_name,$dir);
	myUpload($Picture4,$Picture4_name,$dir);
	myUpload($Picture5,$Picture5_name,$dir);
	myUpload($Picture6,$Picture6_name,$dir);

	if ($Picture1_name == null) $Picture1_name = $bk_Picture1;
	if ($Picture2_name == null) $Picture2_name = $bk_Picture2;
	if ($Picture3_name == null) $Picture3_name = $bk_Picture3;
	if ($Picture4_name == null) $Picture4_name = $bk_Picture4;
	if ($Picture5_name == null) $Picture5_name = $bk_Picture5;
	if ($Picture6_name == null) $Picture6_name = $bk_Picture6;
	if ($Thumbnail_name == null) $Thumbnail_name = $bk_Thumbnail;	

   $field = array(
	"thumbnail",
	"picture1",
	"picture2",
	"picture3",
	"picture4",
	"picture5",
	"picture6",
	);


   $content = array(
	$Thumbnail_name,
	$Picture1_name,
	$Picture2_name,
	$Picture3_name,
	$Picture4_name,
	$Picture5_name,
	$Picture6_name,
	);

   $expression = "code = '$Code'";

   myUpdate($table,$field,$content,$expression);

   header("location:" . $rela_path . "share/msg.php?v=1");

   exit();

}


if (!checkCode($table,$Code)){

	header("location:" . $rela_path . "share/msg.php?v=9002");
  
}

$Query = "select 
picture1,
picture2,
picture3,
picture4,
picture5,
picture6,
thumbnail 
from pro_basic where code='$Code' Limit 1";
$r = myQuery($Query);

$Picture1= $r[0][0];
$Picture2= $r[0][1];
$Picture3= $r[0][2];
$Picture4= $r[0][3];
$Picture5= $r[0][4];
$Picture6= $r[0][5];
$Thumbnail= $r[0][6];

require($rela_path . "inc/header.php");

?>

<!--Content Start-->
<form action="" method="post" enctype="multipart/form-data" name="form1">




<!--hidden filed-->
<input name="action" type="hidden" value="edit">
<input name="Code" type="hidden" value="<?print($Code)?>">

<input name="bk_Picture1" type="hidden" value="<?print($Picture1)?>">
<input name="bk_Picture2" type="hidden" value="<?print($Picture2)?>">
<input name="bk_Picture3" type="hidden" value="<?print($Picture3)?>">
<input name="bk_Picture4" type="hidden" value="<?print($Picture4)?>">
<input name="bk_Picture5" type="hidden" value="<?print($Picture5)?>">
<input name="bk_Picture6" type="hidden" value="<?print($Picture6)?>">
<input name="bk_Thumbnail" type="hidden" value="<?print($Thumbnail)?>">


                    <table width="95%" border="0" align="center">
                      <tr> 
                        
      <td align="right">
	  
	  <input type="image" src="../../../images/bt_cancel.gif" width="78" height="23" onclick="Redirect('../product_menu.php',1);return false;"> 
        <input type="image" src="../../../images/bt_save.gif" width="76" height="22"> 



      </td>
                      </tr>
                    </table>
                    <table width="95%" border="0" align="center">
                      <tr> 
                        <td align="right">&nbsp; </td>
                      </tr>
                      <tr> 
                        
      <td><table border="0" cellspacing="0" cellpadding="2">
          <tr> 
            <td>Thumbnail</td>
            <td> <input type="file" class="text" name="Thumbnail" size="40">
            </td>
          </tr>
          <tr> 
            <td>Picture 1</td>
            <td> <input type="file" class="text" name="Picture1" size="40">
            </td>
          </tr>
          <tr> 
            <td>Picture 2</td>
            <td> <input type="file" class="text" name="Picture2" size="40">
            </td>
          </tr>
          <tr> 
            <td>Picture 3</td>
            <td> <input type="file" class="text" name="Picture3" size="40">
            </td>
          </tr>
          <tr> 
            <td>Picture 4</td>
            <td> <input type="file" class="text" name="Picture4" size="40">
            </td>
          </tr>
          <tr> 
            <td>Picture 5</td>
            <td> <input type="file" class="text" name="Picture5" size="40">
            </td>
          </tr>
          <tr> 
            <td>Picture 6</td>
            <td> <input type="file" class="text" name="Picture6" size="40">
            </td>
          </tr>
        </table>
      </td>
                      </tr>
                    </table>
                    <table width="95%" border="0" align="center">
                      <tr> 
                        
      <td align="right">
	  
	  
	  <input type="image" src="../../../images/bt_cancel.gif" width="78" height="23" onclick="Redirect('../product_menu.php',1);return false;"> 
        <input type="image" src="../../../images/bt_save.gif" width="76" height="22"> 



      </td>
                      </tr>
                    </table>
                  
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
</form>
            <!--Content End-->
            <?
require($rela_path . "inc/footer.php");
?>
        